dean.edwards.name/weblog/2005/02/packer2-beta/

Packer 2.0 (beta)

I’ve released the latest version of my JavaScript compressor/obfuscator.

Packer 2.0 (beta) is a re-write of the original code. This version avoids the need for high ASCII characters. There are some additional compression options and bug fixes to the previous release. The web interface works on browsers that support DOM scripting. Packed code will decompress on all known platforms.

Comments (12)

Leave a comment

Dean, this is just a quick question (I can look into this myself; I just thought you might have a quick answer…)

How does this compare with having webserver compression on (i.e. Apache’s mod_deflate)? I’d expect to make very little difference (probably better with mod_defalte) in transmition time. Is there any actual speed improvement on the parsing of the JS by the browser, though?

  • Comment by: Nelson Menezes
  • Posted:

How does this compare with having webserver compression on (i.e. Apache’s mod_deflate)?

They are not incompatible. If you use both you will get the benefits of both.:-)

  • Comment by: -dean
  • Posted:

If your server deals compressed ascii to the client anyway, isn’t compressing the compressed code again via JS like zipping a file twice, i.e. virtually without effect?

… isn’t compressing the compressed code again via JS like zipping a file twice …?

I’m pretty sure that files compressed by the server are compressed to binary whereas packer is text only. I imagine it is the same as compressing using packer then using something like WinZip after. Try it.

  • Comment by: -dean
  • Posted:

I imagine it is the same as compressing using packer then using something like WinZip after

So do I, concluding that reducing redundancy twice is futile.

Result: [uncompressed|gzipped|rar'ed]
download/cssQuery-source.js: [10.00|3.30|2.91]
download/cssQuery.js:        [ 4.22|2.59|2.51]
gzip: Apache-like gzip compression using  PHP's gzencode() 
rar: using Winrar, method: best
all sizes in KBs

Conclusion: I’m …kinda …wrong, grrr! (though there’s not that much of a difference using a good algo, hmm, besides gzip sucks, everyone knows that, who cares anyway, what’s wrong with not being right, shucks, rats, %$!#!!!…)

Conclusion: I’m …kinda …wrong, grrr!

I think the missing bytes are probably comments. So you are probably more right than wrong…;-)

  • Comment by: -dean
  • Posted:
Hi Dean! Are you planning to release a php class to make this great obfuscator available in server enviroment? It would be great, if we can create these packed javascripts on the fly.:)
  • Comment by: Wiktor
  • Posted:
Hi Wiktor, I wasn’t planning to do this, my PHP skills aren’t great and I don’t really have the time just now. I’d love it if someone else did though! If anyone wants to take a stab, the source code is pretty readable. The ParseMaster.js file can easily be replaced by the preg_replace function in PHP. It’s pretty much based on that anyway. Don’t forget to mail me when it’s done.;-)
  • Comment by: -dean
  • Posted:

Tip: Shrink Your sIFR Dean Edwards’s JavaScript packer can help make sIFR a lighter load for your dial-up visitors….

Hi Dean,

is there a possibility to decode an already encoded script?

Thx in advance, Marc

  • Comment by: Marc
  • Posted:

Marc, not if it has been packed by someone else. You can only decode to a compressed version anyway (no white space). Do you need this feature?

  • Comment by: -dean
  • Posted:

Marc, this feature is available here: http://www.gosu.pl/decoder/

  • Comment by: Józek
  • Posted:

Comments are closed.